package com.study.homework.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * @author andys
 * 测试java堆溢出
 * VM 参数: -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError -XX:-UseGCOverheadLimit
 *
 */
public class HeapOOM {
	static class OOMObject{
		
	}
	
	public static void main(String[] args) {
		List<OOMObject> list = new ArrayList<OOMObject>();
		while(true){
			list.add(new OOMObject());
			System.out.println("......");
		}
	}
}
